package com.gljx.web.controller.JournalController;

import com.gljx.web.Entity.JournalEntry.SubjectStudentStateJournal;
import com.gljx.web.Entity.User;
import com.gljx.web.dao.SubjectStudentStateJournalMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 各科学员状态统计报表
 * 
 * @author Administrator
 *
 */
@Controller
@RequestMapping("/")
public class SubjectStudentStateJournalController {

	@Autowired
	private SubjectStudentStateJournalMapper subjectStudentStateJournalMapper;

	@RequestMapping(value = "querySubjectStudentStateJournal/look.action")
	public String selSubjectStudentStateJournal(HttpServletRequest request) throws Exception {
		// 获取当前操作人
		HttpSession session = request.getSession();
		User user = (User) session.getAttribute("user");
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		String time = sdf.format(new Date());
		Map map = new HashMap();
		map.put("Fcompanyid",user.getFcompanyid());
		List<SubjectStudentStateJournal> subjectStudentStateJournalList= subjectStudentStateJournalMapper.selSubjectStudentStateJournal(map);
		request.setAttribute("time", time);
		request.setAttribute("subjectStudentStateJournalList", subjectStudentStateJournalList);
		return "backHome/journaling/manageJournaling/subjectStudentStateJournaling/subjectStudentStateJournalingList";
	}
}
